<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: Queue manipulation module</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__gdsl__queue.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Queue manipulation module</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct _gdsl_queue *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">GDSL queue type.  <a href="#ga984e79831245f6a8194295299afc71ea"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf">gdsl_queue_alloc</a> (const char *NAME, <a class="el" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f">gdsl_alloc_func_t</a> ALLOC_F, <a class="el" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053">gdsl_free_func_t</a> FREE_F)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new queue.  <a href="#ga98006ec73e032caed82bc17880072abf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gae6bc99e7fd35edc3fd44a80d475e1711">gdsl_queue_free</a> (<a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a queue.  <a href="#gae6bc99e7fd35edc3fd44a80d475e1711"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga2c8f734776c50047396a222f56fe7078">gdsl_queue_flush</a> (<a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flush a queue.  <a href="#ga2c8f734776c50047396a222f56fe7078"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga70db706a296922261eaa7b2c6505264e">gdsl_queue_get_name</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Getsthe name of a queue.  <a href="#ga70db706a296922261eaa7b2c6505264e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga03760715000d25b718b416601213d6f7">gdsl_queue_get_size</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the size of a queue.  <a href="#ga03760715000d25b718b416601213d6f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#gaf6a258d8f3ee5206d682d799316314b1">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga97137e741b7bdddc993cad40dd4bf563">gdsl_queue_is_empty</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a queue is empty.  <a href="#ga97137e741b7bdddc993cad40dd4bf563"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gac8766d595e57f262c7c7c9012226b44f">gdsl_queue_get_head</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the head of a queue.  <a href="#gac8766d595e57f262c7c7c9012226b44f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gabbb3ee270c3dd00915b3ff892f643d54">gdsl_queue_get_tail</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the tail of a queue.  <a href="#gabbb3ee270c3dd00915b3ff892f643d54"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gab11560279877688ad214ca3799b89124">gdsl_queue_set_name</a> (<a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, const char *NEW_NAME)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the name of a queue.  <a href="#gab11560279877688ad214ca3799b89124"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gaea1d99dd4c2cefa1cc23bcb6fcc71aa8">gdsl_queue_insert</a> (<a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, void *VALUE)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert an element in a queue (PUT).  <a href="#gaea1d99dd4c2cefa1cc23bcb6fcc71aa8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga82b677888c8830cf524de6b0bd7f9814">gdsl_queue_remove</a> (<a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an element from a queue (GET).  <a href="#ga82b677888c8830cf524de6b0bd7f9814"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gad729451f16f125127cb27ebbc1716eac">gdsl_queue_search</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a> COMP_F, void *VALUE)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Search for a particular element in a queue.  <a href="#gad729451f16f125127cb27ebbc1716eac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gacd42fa493e982b05f5937299cbacabf4">gdsl_queue_search_by_position</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> POS)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Search for an element by its position in a queue.  <a href="#gacd42fa493e982b05f5937299cbacabf4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga33943cf6767a0a3fc9e5445324fe6dcc">gdsl_queue_map_forward</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a> MAP_F, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a queue from head to tail.  <a href="#ga33943cf6767a0a3fc9e5445324fe6dcc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga23b534e3ef5e617544134c77340e78ae">gdsl_queue_map_backward</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a> MAP_F, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a queue from tail to head.  <a href="#ga23b534e3ef5e617544134c77340e78ae"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga5bd6f3af73ca88ccb369e884b3f78abf">gdsl_queue_write</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a> WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write all the elements of a queue to a file.  <a href="#ga5bd6f3af73ca88ccb369e884b3f78abf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#gad480dc7ccd218b6b79b2cb8385b4f3cb">gdsl_queue_write_xml</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a> WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the content of a queue to a file into XML.  <a href="#gad480dc7ccd218b6b79b2cb8385b4f3cb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__queue.html#ga1aa30cf9ce7bb5fa5aad5f0e55351fee">gdsl_queue_dump</a> (const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> Q, <a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a> WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump the internal structure of a queue to a file.  <a href="#ga1aa30cf9ce7bb5fa5aad5f0e55351fee"></a><br/></td></tr>
</table>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga984e79831245f6a8194295299afc71ea"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_t" ref="ga984e79831245f6a8194295299afc71ea" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct _gdsl_queue* <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>GDSL queue type. </p>
<p>This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module. </p>

<p>Definition at line <a class="el" href="gdsl__queue_8h_source.html#l00054">54</a> of file <a class="el" href="gdsl__queue_8h_source.html">gdsl_queue.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga98006ec73e032caed82bc17880072abf"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_alloc" ref="ga98006ec73e032caed82bc17880072abf" args="(const char *NAME, gdsl_alloc_func_t ALLOC_F, gdsl_free_func_t FREE_F)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> <a class="el" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf">gdsl_queue_alloc</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>NAME</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f">gdsl_alloc_func_t</a>&#160;</td>
          <td class="paramname"><em>ALLOC_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053">gdsl_free_func_t</a>&#160;</td>
          <td class="paramname"><em>FREE_F</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a new queue. </p>
<p>Allocate a new queue data structure which name is set to a copy of NAME. The functions pointers ALLOC_F and FREE_F could be used to respectively, alloc and free elements in the queue. These pointers could be set to NULL to use the default ones:</p>
<ul>
<li>the default ALLOC_F simply returns its argument</li>
<li>the default FREE_F does nothing</li>
</ul>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>nothing. </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">NAME</td><td>The name of the new queue to create </td></tr>
    <tr><td class="paramname">ALLOC_F</td><td>Function to alloc element when inserting it in a queue </td></tr>
    <tr><td class="paramname">FREE_F</td><td>Function to free element when deleting it from a queue </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the newly allocated queue in case of success. </dd>
<dd>
NULL in case of insufficient memory. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gae6bc99e7fd35edc3fd44a80d475e1711" title="Destroy a queue.">gdsl_queue_free()</a> </dd>
<dd>
<a class="el" href="group__gdsl__queue.html#ga2c8f734776c50047396a222f56fe7078" title="Flush a queue.">gdsl_queue_flush()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gae6bc99e7fd35edc3fd44a80d475e1711"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_free" ref="gae6bc99e7fd35edc3fd44a80d475e1711" args="(gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__queue.html#gae6bc99e7fd35edc3fd44a80d475e1711">gdsl_queue_free</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destroy a queue. </p>
<p>Deallocate all the elements of the queue Q by calling Q's FREE_F function passed to <a class="el" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf" title="Create a new queue.">gdsl_queue_alloc()</a>. The name of Q is deallocated and Q is deallocated itself too.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to destroy </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf" title="Create a new queue.">gdsl_queue_alloc()</a> </dd>
<dd>
<a class="el" href="group__gdsl__queue.html#ga2c8f734776c50047396a222f56fe7078" title="Flush a queue.">gdsl_queue_flush()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga2c8f734776c50047396a222f56fe7078"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_flush" ref="ga2c8f734776c50047396a222f56fe7078" args="(gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__queue.html#ga2c8f734776c50047396a222f56fe7078">gdsl_queue_flush</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Flush a queue. </p>
<p>Deallocate all the elements of the queue Q by calling Q's FREE_F function passed to gdsl_queue_allocc(). Q is not deallocated itself and Q's name is not modified.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to flush </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf" title="Create a new queue.">gdsl_queue_alloc()</a> </dd>
<dd>
<a class="el" href="group__gdsl__queue.html#gae6bc99e7fd35edc3fd44a80d475e1711" title="Destroy a queue.">gdsl_queue_free()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga70db706a296922261eaa7b2c6505264e"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_get_name" ref="ga70db706a296922261eaa7b2c6505264e" args="(const gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="group__gdsl__queue.html#ga70db706a296922261eaa7b2c6505264e">gdsl_queue_get_name</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Getsthe name of a queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd>The returned string MUST NOT be freed. </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to get the name from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the name of the queue Q. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gab11560279877688ad214ca3799b89124" title="Set the name of a queue.">gdsl_queue_set_name()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga03760715000d25b718b416601213d6f7"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_get_size" ref="ga03760715000d25b718b416601213d6f7" args="(const gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> <a class="el" href="group__gdsl__queue.html#ga03760715000d25b718b416601213d6f7">gdsl_queue_get_size</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the size of a queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to get the size from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of elements of Q (noted |Q|). </dd></dl>

</div>
</div>
<a class="anchor" id="ga97137e741b7bdddc993cad40dd4bf563"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_is_empty" ref="ga97137e741b7bdddc993cad40dd4bf563" args="(const gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#gaf6a258d8f3ee5206d682d799316314b1">bool</a> <a class="el" href="group__gdsl__queue.html#ga97137e741b7bdddc993cad40dd4bf563">gdsl_queue_is_empty</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if a queue is empty. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if the queue Q is empty. </dd>
<dd>
FALSE if the queue Q is not empty. </dd></dl>

</div>
</div>
<a class="anchor" id="gac8766d595e57f262c7c7c9012226b44f"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_get_head" ref="gac8766d595e57f262c7c7c9012226b44f" args="(const gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#gac8766d595e57f262c7c7c9012226b44f">gdsl_queue_get_head</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the head of a queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to get the head from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the element contained at the header position of the queue Q if Q is not empty. The returned element is not removed from Q. </dd>
<dd>
NULL if the queue Q is empty. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gabbb3ee270c3dd00915b3ff892f643d54" title="Get the tail of a queue.">gdsl_queue_get_tail()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gabbb3ee270c3dd00915b3ff892f643d54"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_get_tail" ref="gabbb3ee270c3dd00915b3ff892f643d54" args="(const gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#gabbb3ee270c3dd00915b3ff892f643d54">gdsl_queue_get_tail</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the tail of a queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to get the tail from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the element contained at the footer position of the queue Q if Q is not empty. The returned element is not removed from Q. </dd>
<dd>
NULL if the queue Q is empty. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gac8766d595e57f262c7c7c9012226b44f" title="Get the head of a queue.">gdsl_queue_get_head()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gab11560279877688ad214ca3799b89124"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_set_name" ref="gab11560279877688ad214ca3799b89124" args="(gdsl_queue_t Q, const char *NEW_NAME)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a> <a class="el" href="group__gdsl__queue.html#gab11560279877688ad214ca3799b89124">gdsl_queue_set_name</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>NEW_NAME</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the name of a queue. </p>
<p>Change the previous name of the queue Q to a copy of NEW_NAME.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to change the name </td></tr>
    <tr><td class="paramname">NEW_NAME</td><td>The new name of Q </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the modified queue in case of success. </dd>
<dd>
NULL in case of insufficient memory. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga70db706a296922261eaa7b2c6505264e" title="Getsthe name of a queue.">gdsl_queue_get_name()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gaea1d99dd4c2cefa1cc23bcb6fcc71aa8"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_insert" ref="gaea1d99dd4c2cefa1cc23bcb6fcc71aa8" args="(gdsl_queue_t Q, void *VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#gaea1d99dd4c2cefa1cc23bcb6fcc71aa8">gdsl_queue_insert</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>VALUE</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Insert an element in a queue (PUT). </p>
<p>Allocate a new element E by calling Q's ALLOC_F function on VALUE. ALLOC_F is the function pointer passed to <a class="el" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf" title="Create a new queue.">gdsl_queue_alloc()</a>. The new element E is then inserted at the header position of the queue Q.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to insert in </td></tr>
    <tr><td class="paramname">VALUE</td><td>The value used to make the new element to insert into Q </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the inserted element E in case of success. </dd>
<dd>
NULL in case of insufficient memory. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga82b677888c8830cf524de6b0bd7f9814" title="Remove an element from a queue (GET).">gdsl_queue_remove()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga82b677888c8830cf524de6b0bd7f9814"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_remove" ref="ga82b677888c8830cf524de6b0bd7f9814" args="(gdsl_queue_t Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#ga82b677888c8830cf524de6b0bd7f9814">gdsl_queue_remove</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove an element from a queue (GET). </p>
<p>Remove the element at the footer position of the queue Q.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to remove the tail from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the removed element in case of success. </dd>
<dd>
NULL in case of Q is empty. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gaea1d99dd4c2cefa1cc23bcb6fcc71aa8" title="Insert an element in a queue (PUT).">gdsl_queue_insert()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gad729451f16f125127cb27ebbc1716eac"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_search" ref="gad729451f16f125127cb27ebbc1716eac" args="(const gdsl_queue_t Q, gdsl_compare_func_t COMP_F, void *VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#gad729451f16f125127cb27ebbc1716eac">gdsl_queue_search</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a>&#160;</td>
          <td class="paramname"><em>COMP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>VALUE</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Search for a particular element in a queue. </p>
<p>Search for the first element E equal to VALUE in the queue Q, by using COMP_F to compare all Q's element with.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| / 2 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; COMP_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to search the element in </td></tr>
    <tr><td class="paramname">COMP_F</td><td>The comparison function used to compare Q's element with VALUE </td></tr>
    <tr><td class="paramname">VALUE</td><td>The value to compare Q's elements with </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first founded element E in case of success. </dd>
<dd>
NULL in case the searched element E was not found. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gacd42fa493e982b05f5937299cbacabf4" title="Search for an element by its position in a queue.">gdsl_queue_search_by_position</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gacd42fa493e982b05f5937299cbacabf4"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_search_by_position" ref="gacd42fa493e982b05f5937299cbacabf4" args="(const gdsl_queue_t Q, ulong POS)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#gacd42fa493e982b05f5937299cbacabf4">gdsl_queue_search_by_position</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>&#160;</td>
          <td class="paramname"><em>POS</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Search for an element by its position in a queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| / 2 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; POS &gt; 0 &amp; POS &lt;= |Q| </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to search the element in </td></tr>
    <tr><td class="paramname">POS</td><td>The position where is the element to search </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the element at the POS-th position in the queue Q. </dd>
<dd>
NULL if POS &gt; |L| or POS &lt;= 0. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gad729451f16f125127cb27ebbc1716eac" title="Search for a particular element in a queue.">gdsl_queue_search()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga33943cf6767a0a3fc9e5445324fe6dcc"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_map_forward" ref="ga33943cf6767a0a3fc9e5445324fe6dcc" args="(const gdsl_queue_t Q, gdsl_map_func_t MAP_F, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#ga33943cf6767a0a3fc9e5445324fe6dcc">gdsl_queue_map_forward</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a>&#160;</td>
          <td class="paramname"><em>MAP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Parse a queue from head to tail. </p>
<p>Parse all elements of the queue Q from head to tail. The MAP_F function is called on each Q's element with USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then <a class="el" href="group__gdsl__queue.html#ga33943cf6767a0a3fc9e5445324fe6dcc" title="Parse a queue from head to tail.">gdsl_queue_map_forward()</a> stops and returns its last examinated element.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; MAP_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to parse </td></tr>
    <tr><td class="paramname">MAP_F</td><td>The map function to apply on each Q's element </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to MAP_F </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first element for which MAP_F returns GDSL_MAP_STOP. </dd>
<dd>
NULL when the parsing is done. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga23b534e3ef5e617544134c77340e78ae" title="Parse a queue from tail to head.">gdsl_queue_map_backward()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga23b534e3ef5e617544134c77340e78ae"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_map_backward" ref="ga23b534e3ef5e617544134c77340e78ae" args="(const gdsl_queue_t Q, gdsl_map_func_t MAP_F, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__queue.html#ga23b534e3ef5e617544134c77340e78ae">gdsl_queue_map_backward</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a>&#160;</td>
          <td class="paramname"><em>MAP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Parse a queue from tail to head. </p>
<p>Parse all elements of the queue Q from tail to head. The MAP_F function is called on each Q's element with USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then <a class="el" href="group__gdsl__queue.html#ga23b534e3ef5e617544134c77340e78ae" title="Parse a queue from tail to head.">gdsl_queue_map_backward()</a> stops and returns its last examinated element.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; MAP_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to parse </td></tr>
    <tr><td class="paramname">MAP_F</td><td>The map function to apply on each Q's element </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to MAP_F Returns the first element for which MAP_F returns GDSL_MAP_STOP. Returns NULL when the parsing is done. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga33943cf6767a0a3fc9e5445324fe6dcc" title="Parse a queue from head to tail.">gdsl_queue_map_forward()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga5bd6f3af73ca88ccb369e884b3f78abf"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_write" ref="ga5bd6f3af73ca88ccb369e884b3f78abf" args="(const gdsl_queue_t Q, gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__queue.html#ga5bd6f3af73ca88ccb369e884b3f78abf">gdsl_queue_write</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a>&#160;</td>
          <td class="paramname"><em>WRITE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>OUTPUT_FILE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write all the elements of a queue to a file. </p>
<p>Write the elements of the queue Q to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; OUTPUT_FILE != NULL &amp; WRITE_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to write. </td></tr>
    <tr><td class="paramname">WRITE_F</td><td>The write function. </td></tr>
    <tr><td class="paramname">OUTPUT_FILE</td><td>The file where to write Q's elements. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to WRITE_F. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#gad480dc7ccd218b6b79b2cb8385b4f3cb" title="Write the content of a queue to a file into XML.">gdsl_queue_write_xml()</a> </dd>
<dd>
<a class="el" href="group__gdsl__queue.html#ga1aa30cf9ce7bb5fa5aad5f0e55351fee" title="Dump the internal structure of a queue to a file.">gdsl_queue_dump()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gad480dc7ccd218b6b79b2cb8385b4f3cb"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_write_xml" ref="gad480dc7ccd218b6b79b2cb8385b4f3cb" args="(const gdsl_queue_t Q, gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__queue.html#gad480dc7ccd218b6b79b2cb8385b4f3cb">gdsl_queue_write_xml</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a>&#160;</td>
          <td class="paramname"><em>WRITE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>OUTPUT_FILE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write the content of a queue to a file into XML. </p>
<p>Write the elements of the queue Q to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then uses WRITE_F to write Q's elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; OUTPUT_FILE != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to write. </td></tr>
    <tr><td class="paramname">WRITE_F</td><td>The write function. </td></tr>
    <tr><td class="paramname">OUTPUT_FILE</td><td>The file where to write Q's elements. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to WRITE_F. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga5bd6f3af73ca88ccb369e884b3f78abf" title="Write all the elements of a queue to a file.">gdsl_queue_write()</a> </dd>
<dd>
<a class="el" href="group__gdsl__queue.html#ga1aa30cf9ce7bb5fa5aad5f0e55351fee" title="Dump the internal structure of a queue to a file.">gdsl_queue_dump()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga1aa30cf9ce7bb5fa5aad5f0e55351fee"></a><!-- doxytag: member="gdsl_queue.h::gdsl_queue_dump" ref="ga1aa30cf9ce7bb5fa5aad5f0e55351fee" args="(const gdsl_queue_t Q, gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__queue.html#ga1aa30cf9ce7bb5fa5aad5f0e55351fee">gdsl_queue_dump</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">gdsl_queue_t</a>&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a>&#160;</td>
          <td class="paramname"><em>WRITE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>OUTPUT_FILE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dump the internal structure of a queue to a file. </p>
<p>Dump the structure of the queue Q to OUTPUT_FILE. If WRITE_F != NULL, then uses WRITE_F to write Q's elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |Q| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Q must be a valid gdsl_queue_t &amp; OUTPUT_FILE != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>The queue to write. </td></tr>
    <tr><td class="paramname">WRITE_F</td><td>The write function. </td></tr>
    <tr><td class="paramname">OUTPUT_FILE</td><td>The file where to write Q's elements. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to WRITE_F. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__queue.html#ga5bd6f3af73ca88ccb369e884b3f78abf" title="Write all the elements of a queue to a file.">gdsl_queue_write()</a> </dd>
<dd>
<a class="el" href="group__gdsl__queue.html#gad480dc7ccd218b6b79b2cb8385b4f3cb" title="Write the content of a queue to a file into XML.">gdsl_queue_write_xml()</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
